<template>
    <a-drawer
            title="查看"
            :visible="visible"
            :width="width || '1000px'"
            :confirmLoading="confirmLoading"
            @close="handleCancel"
    >
        <div class="xlSeeFrom">
            <div class="xlSeeFrom-view">
                <div class="xl-table-content">
                    <xlTable
                            :queryParam="queryParam"
                            :columns="columns"
                            :dataSource="data"
                            rowKey="id"
                            :pagination="pagination"
                            :loading="loading"
                            @change="handleTableChange"
                            bordered
                            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}">
                        >
                        <template v-slot:action="scope">
                            <a @click="seeForm(scope.record)" v-show="scope.record.id != ''">查看</a>
                        </template>
                    </xlTable>
                </div>
            </div>
            <seeForm ref="seeForm"></seeForm>
            <div class="drawer-footer">
                <a-button @click="handleOk" type="primary">
                    关闭
                </a-button>
            </div>
        </div>
    </a-drawer>
</template>

<script>
    import xlMixin from '../../../components/mixin/index'
    import seeForm from '@/views/admin/carrier/hatch_company/model/see'
    export default {
        name: "xlSeeFrom",
        mixins: [xlMixin],
        data() {
            return {
                visible: false,
                type: 1,
                form: {},
                confirmLoading: false,
                tableTitle: '空挂查看',
                columns: [
                    {
                        title: '序号',
                        key: 'rowIndex',
                        align: "center",
                        fixed: 'left',
                        width: '100px',
                        sorter: (a) => a.id,//排序
                        customRender: function (t, r, index) {
                            return parseInt(index) + 1;
                        }
                    },
                    {
                        title: '载体名称',
                        dataIndex: 'carrierName',
                        fixed: 'left',
                        width:'175px',
                        type: 'input'
                    },
                    {
                        title: '企业名称',
                        dataIndex: 'comName',
                        fixed: 'left',
                        width:'175px',
                        type: 'input'
                    },
                    {
                        title: '入驻时间',
                        dataIndex: 'joinDate',
                        type: 'date'
                    },
                    {
                        title: '行业领域',
                        dataIndex: 'industryDomain',
                        type: 'input'
                    },
                    {
                        title: '企业标签',
                        dataIndex: 'tagNames',
                        type: 'input'
                    },
                    {
                        title: '员工人数',
                        dataIndex: 'employeeNum',
                        type: 'input'
                    },
                    {
                        title: '是否空挂',
                        dataIndex: 'isEmptyHanging',
                        type:'radio',
                        typeData:[
                            {
                                dataName:'是',
                                dataValue:true
                            },
                            {
                                dataName:'否',
                                dataValue:false
                            }
                        ]
                    },

                    {
                        title: '销售收入(万元)',
                        dataIndex: 'incomeAmt',
                        type: 'input'
                    },
                    {
                        title: '纳税额(万元)',
                        dataIndex: 'taxAmt',
                        type: 'input'
                    },
                    {
                        title: '自主知识产权申报量',
                        dataIndex: 'iprGrantNum',
                        type: 'input'
                    },
                    {
                        title: '自主知识产权授权量',
                        dataIndex: 'iprOwnedNum',
                        type: 'input'
                    },
                    {
                        title: '企业状态',
                        dataIndex: 'statusDesc',
                        type: 'input'
                    },
                    {
                        title: '操作',
                        dataIndex: 'action',
                        align: "center",
                        fixed: 'right',
                        width: '150px',
                        scopedSlots: {customRender: 'action'},
                    }
                ],
                url: {
                    list: "/system/api/carrierComInfo/pageList",
                    add: '/system/api/carrierComMore/save',
                    edit: '/system/api/carrierComMore/save',
                    delete: "/system/api/carrierComInfo/remove",
                    deleteBatch: "/system/api/carrierComInfo/remove",
                    exportXlsUrl: "/system/api/carrierComInfo/exportExcel",
                    importExcelUrl: "/system/api/carrierComInfo/importExcel",
                    importExcelDemoUrl: "/system/api/carrierComInfo/importTemplate",
                }
            }
        },
        components:{
            seeForm
        },
        props:{
            width:String
        },
        created(){
          this.formatMerge()
        },
        methods: {
            handleOk() {
                this.confirmLoading = false
                this.visible = false
            },
            formatData(data) {
                this.paramMore.creditCode = data.creditCode
                this.pageOnload()
                    .then(_=>{
                        this.visible = true
                    })
            },
            handleCancel() {
                //关闭窗口
                this.visible = false
            }
        }
    }
</script>


<style lang="less">
    .ant-drawer-body {
        width: 100%;
        height: calc(100% - 55px);

        .xlSeeFrom {
            width: 100%;
            height: 100%;

            .xlSeeFrom-view{
                width: 100%;
                height: calc(100% - 50px);
                overflow-y: scroll;
                .ant-descriptions-item-label{
                    padding: 16px;
                    word-break: keep-all;
                }
                .ant-card{
                    margin-bottom: 10px;
                }
            }

            .drawer-footer {
                width: 100%;
                height: 50px;
                border-top: 1px solid #e8e8e8;
                border-radius: 0 0 4px 4px;
                display: flex;
                align-items: center;
                justify-content: flex-end;
            }
        }
    }
</style>
